Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



🚀 Add BucketSort Algorithm
🗒️ General
This PR introduces the Bucket Sort algorithm to the project Bucket Sort is a non-comparison-based sorting algorithm that distributes elements into buckets and sorts them individually.
💡 Idea Behind Bucket Sort
Bucket Sort works by dividing the input data into several buckets and sorting each bucket individually. Finally, the sorted buckets are concatenated to produce the sorted output.
🤔 Details
Bucket Division:
The algorithm takes the square root of the number of values as bucket ranges.
Bucket Distribution:
Elements are distributed into appropriate buckets based on their value.
Sorting Individual Buckets:
Each bucket is sorted using an sorting algorithm determined by the provided class in the property (
GnomeSort).Concatenation:
The sorted buckets are merged into the result array which is returned.
📉 Downsides of Bucket Sort
I am not sure if this should be considered as a sorting algorithm itself, because it does not acually sort the values but only distributes them into smaller buckets that then need to be sorted.
🛠 Implementation Note:
This, while not a realy sorting algorithm, would allow for a system, that determines, which sorting algorithm should be used on a array and use it accordingly. The implementations was done so that the used algorithm for the sorting can be replaced by changing the provided class but can be extended to have a more dynamic approach. This would however need to have some sort of decision system on which algorithm to use based on the input.